// 链接数据库
var mongoose = require('mongoose');
var connComment = null ;
var connArticle = null;

exports.getConDB = function() {
  if(!connComment){
    connComment = mongoose.createConnection('mongodb://127.0.0.1:27017/comment');
  }

  if(!connArticle){
    connArticle = mongoose.createConnection('mongodb://127.0.0.1:27017/article'); 
  }
  
  var connectDB = {
    connComment: connComment,
    connArticle: connArticle
  }

  return connectDB
}

